﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Be.Windows.Forms;
using System.Globalization;
using System.Text.RegularExpressions;

namespace Chip8
{
    public partial class frmMemory : Form
    {
        public frmEmu Mainform;
        public frmMemory()
        {
            InitializeComponent();
        }

        private void frmMemory_FormClosing(object sender, FormClosingEventArgs e)
        {
            e.Cancel = true;
            this.Hide();
        }

        private void hexMemory_KeyUp(object sender, KeyEventArgs e)
        {
            if (hexMemory.SelectionStart >= 0 && hexMemory.ByteProvider.HasChanges())
            {
                hexMemory.ByteProvider.ApplyChanges();
                for (int x = 0; x <= hexMemory.ByteProvider.Length - 1;x++)
                Mainform.MainSystem.Memory[x] = hexMemory.ByteProvider.ReadByte(x);
                hexMemory.Invalidate();
          
            }
        }
    }
}
